<template>
  <el-row>
    <el-col :span="10" class="dataArea">
      <el-statistic :title="titleData" :value="classTotal" />
    </el-col>
  </el-row>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { getClassTotalApi } from "@/api/container";

// 接收父组件传递的属性来获取对应的请求地址属性
const { type,name } = defineProps([
  'type',
  'name'
])
const titleData = ref(name + '总数量')
// 获取数据
const classTotal = ref(0);
onMounted(async () => {
  // console.log(type);
  const data = await getClassTotalApi(type);
  classTotal.value = data.data;
});
</script>
<style lang="scss">
.dataArea {
  border: 1px solid black;
  box-sizing: border-box;
  background-color: rgb(176, 223, 241);
  margin-top: 20px;
}
</style>
